package com.example.june.demo;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.Button;

public class DialogActivity extends Activity implements View.OnClickListener {
    private Button btn_cancel,btn_ok;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //设置dialog不显示默认的标题文字
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.activity_dialog2);
        btn_ok = (Button) findViewById(R.id.btn_ok);
        btn_cancel = (Button) findViewById(R.id.btn_cancel);
        btn_ok.setOnClickListener(this);
        btn_cancel.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            //确定
            case R.id.btn_ok:
                Intent intent = new Intent();
                intent.setClass(DialogActivity.this,FingerActivity.class);
                startActivity(intent);
                break;
            //取消
            case R.id.btn_cancel:
                finish();
                break;
            default:
                break;
        }
    }
}
